<%@page import="com.pb.news.entity.News"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../common/common.jsp" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String id = request.getParameter("id");
// 调用后台方法，通过id查找新闻明细
News news = new News();
try{
news = newsService.getNewsById(Integer.parseInt(id));
}catch(NumberFormatException e){
	
}
//System.out.print(news);
request.setAttribute("news", news);
%>
<div class="main-text-box-tbg">
	<div class="main-text-box-bbg">
	    <div class="article-box">
	        <h1><c:out value="${news['title']}"></c:out></h1>
	        <div class="source-bar">发布者：<c:out value="${news.author}"></c:out> 分类：<%=news.getCategoryName()%>  更新时间：<%=news.getCreateDate() %></div>
	        <div class="article-content">
	            <span class="article-summary"><b>摘要：</b><c:out value="${news.summary}"></c:out></span>
	            <%
	            if(news.getPicPath() == null || news.getPicPath().equals("")){
	            %>
	            没有新闻图片
	            <%}else{%>
	            <img src="<%=request.getContextPath()%>/upload/<%=news.getPicPath()%>">
	            <%} %>
	            <c:out value="${news.content}" escapeXml="false"></c:out>
	        </div>
	    </div>
	</div>
</div>

</body>
</html>